Repository navigation
Fixes #234: make_described_run spreads image_count over technical repeats - #236
Merged
Merged
Conversation
…ribed_run image_count is the member total over its units, but the helper wrote it into each technical repeat (v34 CTRL/rep1: 24 images instead of 12; DrugA/rep1: 22 instead of 11). Distribute exactly image_count images, earlier units by sorted ID taking the remainder, and refuse (ValueError naming the member) when image_count < technical repeats. Fix the test whose _expected() repeated the bug; add v34 and refusal regressions. Fixes #234 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #234
What
make_described_run(testing_described.py) now distributes exactlymember.image_countimages across the member's technical repeats:image_count // neach, and the firstimage_count % nunits (sorted unit ID) get one more. Ifimage_count < nit raisesValueErrornaming the member and repeat, before anything is written. The existing_expected()intests/test_make_described_run.py, which repeated the bug, is corrected.Why
image_countis the member total over its units (description_reconcile.py:242-263), but the helper wrote it into every technical repeat, so the biological N was wrong while the test passed.Regression evidence
New tests in
tests/test_make_described_run.py, with expected counts read from the parsed v34 description rather than the helper's unit expansion:member.image_count(43 FOVs overall).image_count = 1raises, naming'DrugA', and writes no experiment folder.Old code (src reverted, new tests kept): 3 failed, 20 passed. The v34 count test got CTRL/rep1 = 24 (12 per unit) and DrugA/rep1 = 22 (11 per unit), and the refusal case did not raise. With the fix: all pass.
Checks
python tools/check.py(fresh venv,.[dev,notebook,zarr]): exit 0, 4696 passed, 4 skipped (3 case-insensitive filesystem checks, 1 file-mode check running as root), 0 failed.Generated by Claude Code